const hexList: string[] = [];
for (let i = 0; i <= 15; i++) {
  hexList[i] = i.toString(16);
}

export function buildUUID(lenth: number = 16): string {
  let uuid = '';
  for (let i = 0; i < lenth; i++) {
    uuid += hexList[(Math.random() * 16) | 0];
  }
  return uuid.replace(/-/g, '');
}
export function buildUrl(url: string, lastUrl: string) :string{

  if (url.endsWith("/")) {
    if (!lastUrl.startsWith("/")) {
      return url + lastUrl;
    } else {
      return url + lastUrl.replace("/", "")
    }
  } else {
    if (lastUrl.startsWith("/")) {
      return url + lastUrl;
    } else {
      return url + "/" + lastUrl
    }
  }

}
